package com.admin.action.boraction;

import com.admin.Action;
import com.admin.service.borservice.BorServiceImpl;
import com.google.gson.Gson;
import com.pojo.BorrowerBean;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

public class GetBorCancelInfoAction extends Action {

    Gson gson = new Gson();
    @Override
    public void execute(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        BorServiceImpl service = new BorServiceImpl();
        BorrowerBean bor = new BorrowerBean();
        bor.setIsCancel(request.getParameter("isCancel"));
        System.out.println("状态"+bor.getIsCancel());
        List<BorrowerBean> list = service.getBorCancelInfo(bor);

        String allBorInfoJson = gson.toJson(list);
        PrintWriter out = response.getWriter();
        out.print(allBorInfoJson);
    }
}
